from django.apps import AppConfig
import logging
# 配置日志
logger = logging.getLogger(__name__)
class SpiderConfig(AppConfig):
    """爬虫应用配置"""
    default_auto_field = 'django.db.models.BigAutoField'
    name = 'spider'
    verbose_name = '电影爬虫'
def ready(self):
    """应用启动时的初始化操作"""
    try:
        # 导入信号处理器
        from . import signals
        logger.info("Spider应用初始化成功")
    except ImportError:
        logger.warning("未找到信号处理器")
    except Exception as e:
        logger.error(f"应用初始化失败: {str(e)}")